#ifndef CPHOTONMAP_H
#define CPHOTONMAP_H

#include "cphotoncache.h"
#include "cdrawable.h"

class CPhotonMap: public CDrawable
{
public:
    CPhotonMap();
    ~CPhotonMap();

    void locatePhotons (CPoint3f& pos, const CVecteur3f &normal, float fMinCos, int nPhotons, float & maxDistSquare, std::vector<std::pair<float, int> > & result, int firstNode);
    bool reserve(int myNumber);
    int findNearestPhotons (CPoint3f& pos, const CVecteur3f & normal, float maxAngle, int number, priorityHeap & result);

    bool addPhoton (const photon & newPhoton, const CVecteur3f & newNormal);

    float getWattagePerPhoton();
    void setWattagePerPhoton(float newWattagePerPhoton);

    void paint();

    float fLastMaxDistSquare;
    float fSecondLastMaxDistance;
    class CPhotonCache *container;
    int number;
    float wattagePerPhoton;

};

#endif // CPHOTONMAP_H
